<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRenewsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('renews', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('order_id');                    // 原始订单ID
            $table->smallInteger('year')->default(0);       // 续费年限
            $table->integer('saler_id');                    // 业务员ID
            $table->integer('amount');                      // 续费总金额
            $table->string('contract_no');                  // 合同号
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('renews');
    }
}
